# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormat do
  @moduledoc """
  Describes the format of the data within its storage location.

  ## Attributes

  *   `compressionFormat` (*type:* `String.t`, *default:* `nil`) - Optional. The compression type associated with the stored data. If unspecified, the data is uncompressed.
  *   `csv` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormatCsvOptions.t`, *default:* `nil`) - Optional. Additional information about CSV formatted data.
  *   `format` (*type:* `String.t`, *default:* `nil`) - Output only. The data format associated with the stored data, which represents content type values. The value is inferred from mime type.
  *   `iceberg` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormatIcebergOptions.t`, *default:* `nil`) - Optional. Additional information about iceberg tables.
  *   `json` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormatJsonOptions.t`, *default:* `nil`) - Optional. Additional information about CSV formatted data.
  *   `mimeType` (*type:* `String.t`, *default:* `nil`) - Required. The mime type descriptor for the data. Must match the pattern {type}/{subtype}. Supported values: application/x-parquet application/x-avro application/x-orc application/x-tfrecord application/x-parquet+iceberg application/x-avro+iceberg application/x-orc+iceberg application/json application/{subtypes} text/csv text/ image/{image subtype} video/{video subtype} audio/{audio subtype}
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :compressionFormat => String.t() | nil,
          :csv =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormatCsvOptions.t() | nil,
          :format => String.t() | nil,
          :iceberg =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormatIcebergOptions.t() | nil,
          :json =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormatJsonOptions.t() | nil,
          :mimeType => String.t() | nil
        }

  field(:compressionFormat)
  field(:csv, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormatCsvOptions)
  field(:format)

  field(:iceberg, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormatIcebergOptions)

  field(:json, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormatJsonOptions)
  field(:mimeType)
end

defimpl Poison.Decoder, for: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormat do
  def decode(value, options) do
    GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormat.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1StorageFormat do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
